<?
//<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
$tmp_login_date___ = true;
require ("s_inc.php");
//$tmp_login_date___ = false;
if ($_REQUEST['action'] == "login" and $_SESSION['check_auth_number'] != $_POST['check_auth_number'])
{
	echo g::msg("驗證碼有誤！登錄失敗！");
	g::gowin("index.php");
} else
	if ($_REQUEST['action'] == "login")
	{
		if (admin_main::login($_POST['account'], $_POST['pwd'], $menu['table'], $menu['masterField'], $menu['password']))
		{
			$_SESSION[$menu['adminStr']] = $_POST['account'];
			g::gowin("index.php");
		}else
		{
		    echo g::msg("帳號或密碼有誤！登錄失敗！");
			g::gowin("index.php");
		}
	} elseif ($_REQUEST['action'] == "outLogin")
	{
		$_SESSION[$menu['adminStr']] = '';
		$_SESSION[$menu[$menu['adminStr'] . 'adminChk']] = '';
		$_SESSION[$menu[$menu['adminStr'] . 'admin_qx']] = '';
	}
?>
<? include("s_head.tpl.php"); ?>
<script type="text/javascript">
if(self!=top)
{
	top.location = self.location;
}
</script>
<BR><BR><BR><BR><BR>
<FORM method="post" onsubmit="return XypForm(this)">
<TABLE class=tableoutline cellSpacing=1 cellPadding=4 width=250 align=center border=0>
  <TBODY>
  <TR class=tbhead>
    <TD colSpan=2 height=25>
	<INPUT type=hidden value="login" name="action"> 
      <DIV align=center><B>登 錄 入 口</B></DIV></TD></TR>
  <TR class="_data_">
    <TD width=118><FONT class=normalfont>用戶名:</FONT></TD>
    <TD width=232><FONT face=Verdana size=2>
	<INPUT name="account" class="text"  require="1" msg="请输入用戶名!" id="account"  value="<?=$_POST['account']?>"></FONT></TD></TR>
  <TR class="_data_">
    <TD width=118><FONT class=normalfont>密碼:</FONT></TD>
    <TD width=232><FONT class=normalfont>
	<input name="pwd" type="password"  require="1"  msg="请输入密碼!" class=text id="pwd" value="<?=$_POST['pwd']?>">
    </FONT></TD>
  </TR>
  <TR class="_data_">
    <TD><FONT class=normalfont>驗證碼:</FONT></TD>
    <TD><FONT class=normalfont>
      <input name="check_auth_number"  require="1" minlen="4" maxlen="4"  msg="驗證碼有误!"  type="password" class="text" id="check_auth_number" size="4" maxlength="4">
      <img src="s_imgcode.php"> </FONT></TD>
  </TR>
  <TR class=tbhead>
    <TD colSpan=2 align="center">
	  <INPUT class="bginput" type="submit" value="登錄"> 
	  <INPUT class="bginput" type="reset" value="重置">
	</TD>
 </TR>
 </TBODY>
 </TABLE>
</FORM>
<? include("s_copyRight.tpl.php"); ?>